<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QToolTip Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QToolTip Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QToolTip class provides tool tips (balloon help) for any
widget. <a href="#details">More...</a></p>

<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qtooltip.html#QToolTip">__init__</a></b> (<i>self</i>, QToolTip)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />QFont <b><a href="qtooltip.html#font">font</a></b> ()</li><li><div class="fn" /><b><a href="qtooltip.html#hideText">hideText</a></b> ()</li><li><div class="fn" />bool <b><a href="qtooltip.html#isVisible">isVisible</a></b> ()</li><li><div class="fn" />QPalette <b><a href="qtooltip.html#palette">palette</a></b> ()</li><li><div class="fn" /><b><a href="qtooltip.html#setFont">setFont</a></b> (QFont)</li><li><div class="fn" /><b><a href="qtooltip.html#setPalette">setPalette</a></b> (QPalette)</li><li><div class="fn" /><b><a href="qtooltip.html#showText">showText</a></b> (QPoint&#160;<i>pos</i>, QString&#160;<i>text</i>, QWidget&#160;<i>widget</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qtooltip.html#showText-2">showText</a></b> (QPoint&#160;<i>pos</i>, QString&#160;<i>text</i>, QWidget&#160;<i>w</i>, QRect&#160;<i>rect</i>)</li><li><div class="fn" />QString <b><a href="qtooltip.html#text">text</a></b> ()</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QToolTip class provides tool tips (balloon help) for any
widget.</p>
<p>The tip is a short piece of text reminding the user of the
widget's function. It is drawn immediately below the given position
in a distinctive black-on-yellow color combination. The tip can be
any <a href="qtextedit.html">rich text</a> formatted string.</p>
<p>Rich text displayed in a tool tip is implicitly word-wrapped
unless specified differently with <tt>&lt;p
style='white-space:pre'&gt;</tt>.</p>
<p>The simplest and most common way to set a widget's tool tip is
by calling its <a href="qwidget.html#toolTip-prop">QWidget.setToolTip</a>() function.</p>
<p>It is also possible to show different tool tips for different
regions of a widget, by using a <a href="qhelpevent.html">QHelpEvent</a> of type <a href="qevent.html#Type-enum">QEvent.ToolTip</a>. Intercept the help
event in your widget's <a href="qwidget.html#event">event()</a>
function and call <a href="qtooltip.html#showText">QToolTip.showText</a>() with the text you
want to display. The <a href="widgets-tooltips.html">Tooltips</a>
example illustrates this technique.</p>
<p>If you are calling <a href="qtooltip.html#hideText">QToolTip.hideText</a>(), or <a href="qtooltip.html#showText">QToolTip.showText</a>() with an empty
string, as a result of a <a href="qevent.html#Type-enum">ToolTip</a>-event you should also call
<a href="qevent.html#ignore">ignore()</a> on the event, to signal
that you don't want to start any tooltip specific modes.</p>
<p>Note that, if you want to show tooltips in an item view, the
model/view architecture provides functionality to set an item's
tool tip; e.g., the <a href="qtablewidgetitem.html#setToolTip">QTableWidgetItem.setToolTip</a>()
function. However, if you want to provide custom tool tips in an
item view, you must intercept the help event in the <a href="qabstractitemview.html#viewportEvent">QAbstractItemView.viewportEvent</a>()
function and handle it yourself.</p>
<p>The default tool tip color and font can be customized with
<a href="qtooltip.html#setPalette">setPalette</a>() and <a href="qtooltip.html#setFont">setFont</a>(). When a tooltip is currently
on display, <a href="qtooltip.html#isVisible">isVisible</a>()
returns true and <a href="qtooltip.html#text">text</a>() the
currently visible text.</p>
<p><b>Note:</b> Tool tips use the inactive color group of <a href="qpalette.html">QPalette</a>, because tool tips are not active
windows.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QToolTip" />QToolTip.__init__ (<i>self</i>, <a href="qtooltip.html">QToolTip</a>)</h3><h3 class="fn"><a name="font" /><a href="qfont.html">QFont</a> QToolTip.font ()</h3><p>Returns the font used to render tooltips.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qtooltip.html#setFont">setFont</a>().</p>


<h3 class="fn"><a name="hideText" />QToolTip.hideText ()</h3><p>Hides the tool tip. This is the same as calling <a href="qtooltip.html#showText">showText</a>() with an empty string.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qtooltip.html#showText">showText</a>().</p>


<h3 class="fn"><a name="isVisible" />bool QToolTip.isVisible ()</h3><p>Returns true if this tooltip is currently shown.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also</b> <a href="qtooltip.html#showText">showText</a>().</p>


<h3 class="fn"><a name="palette" /><a href="qpalette.html">QPalette</a> QToolTip.palette ()</h3><p>Returns the palette used to render tooltips.</p>
<p><b>Note:</b> Tool tips use the inactive color group of <a href="qpalette.html">QPalette</a>, because tool tips are not active
windows.</p>
<p><b>See also</b> <a href="qtooltip.html#setPalette">setPalette</a>().</p>


<h3 class="fn"><a name="setFont" />QToolTip.setFont (<a href="qfont.html">QFont</a>)</h3><p>Sets the <i>font</i> used to render tooltips.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qtooltip.html#font">font</a>().</p>


<h3 class="fn"><a name="setPalette" />QToolTip.setPalette (<a href="qpalette.html">QPalette</a>)</h3><p>Sets the <i>palette</i> used to render tooltips.</p>
<p><b>Note:</b> Tool tips use the inactive color group of <a href="qpalette.html">QPalette</a>, because tool tips are not active
windows.</p>
<p>This function was introduced in Qt 4.2.</p>
<p><b>See also</b> <a href="qtooltip.html#palette">palette</a>().</p>


<h3 class="fn"><a name="showText" />QToolTip.showText (<a href="qpoint.html">QPoint</a>&#160;<i>pos</i>, QString&#160;<i>text</i>, <a href="qwidget.html">QWidget</a>&#160;<i>widget</i>&#160;=&#160;None)</h3><p>Shows <i>text</i> as a tool tip, with the global position
<i>pos</i> as the point of interest. The tool tip will be shown
with a platform specific offset from this point of interest.</p>
<p>If you specify a non-empty rect the tip will be hidden as soon
as you move your cursor out of this area.</p>
<p>The <i>rect</i> is in the coordinates of the widget you specify
with <i>w</i>. If the <i>rect</i> is not empty you must specify a
widget. Otherwise this argument can be 0 but it is used to
determine the appropriate screen on multi-head systems.</p>
<p>If <i>text</i> is empty the tool tip is hidden. If the text is
the same as the currently shown tooltip, the tip will <i>not</i>
move. You can force moving by first hiding the tip with an empty
text, and then showing the new tip at the new position.</p>


<h3 class="fn"><a name="showText-2" />QToolTip.showText (<a href="qpoint.html">QPoint</a>&#160;<i>pos</i>, QString&#160;<i>text</i>, <a href="qwidget.html">QWidget</a>&#160;<i>w</i>, <a href="qrect.html">QRect</a>&#160;<i>rect</i>)</h3><p>This is an overloaded function.</p>
<p>This is analogous to calling QToolTip.showText(<i>pos</i>,
<i>text</i>, <i>w</i>, QRect())</p>


<h3 class="fn"><a name="text" />QString QToolTip.text ()</h3><p>Returns the tooltip text, if a tooltip is visible, or an empty
string if a tooltip is not visible.</p>
<p>This function was introduced in Qt 4.4.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.9.1 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2011</td><td align="right" width="25%">Qt&#160;4.8.0</td></tr></table></div></address></body></html>